﻿using System;
using System.Collections.Generic;
using Eb;

namespace Ec
{
    public class DefApp : ComponentDef
    {
        //---------------------------------------------------------------------
        public override void defAllProp(Dictionary<string, string> map_param)
        {
        }
    }

    public class ClientApp<T> : Component<T> where T : DefApp, new()
    {
        //---------------------------------------------------------------------
        BotsConfig mBotsConfig = new BotsConfig();

        //---------------------------------------------------------------------
        public override void init()
        {
            EbLog.Note("ClientApp.init()");

            EntityMgr.getDefaultEventPublisher().addHandler(Entity);

            BotsPluginHelper.setupBotsPlugin(mBotsConfig.PluginDllFileName, mBotsConfig.PluginClassName,
                mBotsConfig.Ip, mBotsConfig.Port, EntityMgr);
        }

        //---------------------------------------------------------------------
        public override void release()
        {
            EbLog.Note("ClientApp.release()");
        }

        //---------------------------------------------------------------------
        public override void update(float elapsed_tm)
        {
        }

        //---------------------------------------------------------------------
        public override void handleEvent(object sender, EntityEvent e)
        {
        }
    }
}
